using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace QLNhaSach.GUI.NhanVienQuanLySach
{
    public partial class NVQLSach : Form
    {
        public int manvqlsach;
        public NVQLSach()
        {
            InitializeComponent();
        }

        private void CloseAllChildForm()
        {
            Form[] frm = this.MdiChildren;
            for (int i = 0; i < frm.Length; i++)
            {
                frm[i].Close();
            }
        }

        private void btnTTCaNhan_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            ThongTinCaNhan fmThongTinCaNhan = new ThongTinCaNhan();
            fmThongTinCaNhan.manvChilder = manvqlsach;
            fmThongTinCaNhan.MdiParent = this;

            fmThongTinCaNhan.Show();
        }

        private void btnQLSach_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            QuanLySach fmQuanLySach = new QuanLySach();
            fmQuanLySach.MdiParent = this;

            fmQuanLySach.Show();
        }

        private void btnSLSachTon_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            SoLuongSachTon fmSLSachTon = new SoLuongSachTon();
            fmSLSachTon.MdiParent = this;
            fmSLSachTon.Show();
        }

        private void buttonX4_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            PhieuNhapSach fmPhieuNhapSach = new PhieuNhapSach();
            fmPhieuNhapSach.MdiParent = this;
            fmPhieuNhapSach.Show();
        }

        private void btnDangXuat_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            DangXuat fmDangXuat = new DangXuat();
            fmDangXuat.MdiParent = this;
            fmDangXuat.Show();
            
        }

        private void NVQLSach_Load(object sender, EventArgs e)
        {
            btnTTCaNhan_Click(sender, e);
        }

        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            TimKiemSach fmTimKiem = new TimKiemSach();
            fmTimKiem.MdiParent = this;
            fmTimKiem.Show();
        }

        private void btnDangXuat_Click_1(object sender, EventArgs e)
        {
            CloseAllChildForm();
            DangXuat fmDangXuat = new DangXuat();
            fmDangXuat.maNV = manvqlsach;
            fmDangXuat.MdiParent = this;
            fmDangXuat.Show();
        }

       
    }
}